package com.example.a12138.myapplication.http;

import com.example.a12138.myapplication.model.Book;
import com.example.a12138.myapplication.model.Realinfo;
import com.example.a12138.myapplication.model.User;
import com.xdw.mvp.model.Result;

import java.util.List;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

public interface HttpApiInterface {

    @GET("api/get_book_byid/{book_id}")
    Observable<Result<Book>> getBookById(@Path("book_id") int book_id);

    @FormUrlEncoded
    @POST("api/login")
    Observable<Result<User>> login(@Field("username") String username, @Field("password") String password);

    @GET("api/get_real_info/{real_info_type_id}/{page}")
    Observable<Result<List<Realinfo>>> getRealinfoList(@Path("real_info_type_id") int real_info_type_id,@Path("page") int page);
}


